package chapte05.dome.Examole;

public class demo05 {
    public static void main(String[] args) {
        String s1 = "String"; // 声明一个字符串
        String s2 = "Str";
        System.out.println("判断是否以字符串str开头:" + s1.startsWith("str"));
        System.out.println("判断是否以字符串ng结尾:" + s1.endsWith("tri"));
        System.out.println("判断字符是否为空" + s1.isEmpty());
        System.out.println("判断两个字符是否相等" + s1.equals(s2));
    }
}
